<%@page import="java.util.TreeMap"%>
<%@page import="java.util.Map"%>
<%@page import="entities.MetaSeo"%>
<%@page import="systems.AdsSystem"%>
<%@page import="helpers.StringHelper"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.Domain"%>
<% 
String name  = (String) request.getAttribute("name");
Domain domain = (Domain) request.getAttribute("domain");
String error = (String) request.getAttribute("error");
String nameServer = UrlHelper.getDomainServer(request);
MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));

String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);

if (domain != null) {
	replates.put("__DOMAIN_NAME__", domain.getDomain());
	replates.put("__WHOIS_INFO__", StringHelper.cutString(StringHelper.html2text(domain.getWhois()), 30));
	
	title = StringHelper.replateContent(metaseo.getTitleInfo(), replates);
	description = StringHelper.replateContent(metaseo.getDescriptionInfo(), replates);
	keywords = StringHelper.replateContent(metaseo.getKeywordsInfo(), replates);
	url = StringHelper.replateContent(metaseo.getOgurlInfo(), replates);
}
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/showsite/layouts/header.jsp" />

		<div class="row-fluid">
		
			<div class="span8">
				<div class="row-fluid">
					<section>
						<div class="block2">
							<div class="title-block">
								<h3>Check Whois</h3>
								<div class="divider-arrow"></div>
							</div>
							<div class="content-block">
								<form action="/whois" class="input-append" id="search">
									<input type="text" role="textbox" class="xlarge ui-autocomplete-input" id="artist_search" name="q" placeholder="ex: google.com" value="">
									<input class="btn search-bt" type="submit" value="">
								</form>
							</div>
							
							<hr />
							<% if (domain != null) { %>
							<h4>Whois <%=domain.getDomain() %> Info</h4>
							<div class="adv">
				      			<%=AdsSystem.getAds468x15() %>
				      		</div>
				      		<br />
				      		<div class="adv pull-right">
								<%=AdsSystem.getAds200x200() %>
							</div>
							<%=domain.getWhois() %>
							<% } %>
						</div>
						
					</section>
					
				</div>
			</div>
			
			<jsp:include page="/templates/showsite/elements/right.jsp" />
		</div>
	
<jsp:include page="/templates/showsite/layouts/footer.jsp" />